<?
$teacher_id=$_GET['m'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>แก้ไขข้อมูลอาจารย์</title>
<style type="text/css">
.body {
}

#boxstye{
	height: auto;
	width: 760px;
	background-color: #444041;
}
body,td,th {
	font-size: 14px;
	color: #FFF;
}
</style>
</head>
<body>

<div id="boxstye">

<?
$sql_edit = "select * from tb_teacher where teacher_id = '$teacher_id' ";
$result_edit = $dbfunc->query($sql_edit);
//ดึงข้อมูลแบบอาร์เรย์  โดยเลือกแสดงแค่เรคคอร์ดเดียว (ไม่ใช้ while)
$fetch = mysql_fetch_array($result_edit);  
?>


<form action="?module=admin&amp;page=update_teacher" method="post" enctype="multipart/form-data" name="frm_teacher" id="frm_teacher">
  <table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <th colspan="3" align="center">&nbsp;</th>
    </tr>
    <tr>
      <th height="35" colspan="3" align="center" bgcolor="#999999">แก้ไขข้อมูลส่วนตัว<br /></th>
    </tr>
    <tr>
      <td width="340" height="35" align="right" bgcolor="#999999"><span class="style_1">คำนำหน้าชื่อ</span></td>
      <td width="7" height="35" bgcolor="#999999">:</td>
      <td width="523" height="35" bgcolor="#999999"><span class="style_1">
      <select name="sec_ major" size="1" id="sec_ major">
        <option value="000">นาย</option>
        <option value="001">นาง</option>
        <option value="002">นางสาว</option>
      </select> 
        
        <input type="hidden" name="teacher_id" id="teacher_id" value="<? echo $fetch['teacher_id'];?>" />
      </span></td>
    <tr>
      <td width="340" height="35" align="right" bgcolor="#999999"><span class="style_1">ชื่อ</span></td>
      <td width="7" height="35" bgcolor="#999999">:</td>
      <td width="523" height="35" bgcolor="#999999"><span class="style_1">
        <input name="teacher_name" type="text" id="teacher_name" size="20" maxlength="40" value="<? echo $fetch['teacher_name'] ?>" />
        
      </span></td>
    </tr>
    <tr>
      <td height="35" align="right" bgcolor="#999999"><span class="style_1">นามสกุล</span></td>
      <td height="35" bgcolor="#999999">:</td>
      <td height="35" bgcolor="#999999"><span class="style_1">
        <input name="teacher_surname" type="text" id="teacher_surname" size="30" maxlength="80" value="<? echo $fetch['teacher_surname'] ?>" />
      </span></td>
    </tr>
    
    
    <tr>
      <td height="35" align="right" bgcolor="#999999"><span class="style_1">เพศ</span></td>
      <td height="35" bgcolor="#999999">:</td>
      <td height="35" bgcolor="#999999"><span class="style_1">
        <input type="radio" name="teacher_sex" id="radio" value="M" checked="checked" />
        ชาย
        <input type="radio" name="teacher_sex" id="radio2" value="F" />
        หญิง</span></td>
    </tr>
    <tr>
      <td height="35" align="right" bgcolor="#999999"><span class="style_1">วันเดือนปีเกิด</span></td>
      <td height="35" bgcolor="#999999">:</td>
      <td height="35" bgcolor="#999999"><span class="style_1">
        <input name="teacher_birthday" type="text" id="teacher_birthday" size="15" readonly="readonly" value="<? echo $fetch['teacher_birthday'] ?>" />
        <script language="JavaScript" type="text/javascript">
			$(function(){
				$('#teacher_birthday').datepicker({ dateFormat: 'yy-mm-dd' });
			});
        </script>
      </span></td>
    </tr>
    
    <tr>
      <td height="35" align="right" bgcolor="#999999"><span class="style_1">อีเมล์</span></td>
      <td height="35" bgcolor="#999999">:</td>
      <td height="35" bgcolor="#999999"><span class="style_1">
        <input name="teacher_email" type="text" id="teacher_email" size="30" maxlength="40" onblur="return checkemail()" value="<? echo $fetch['teacher_email'] ?>"/>
      </span></td>
    </tr>
    <tr>
      <td height="35" align="right" bgcolor="#999999"><span class="style_1">ที่อยู่</span></td>
      <td height="35" bgcolor="#999999">:</td>
      <td height="35" bgcolor="#999999"><span class="style_1">
        <textarea name="teacher_add" id="teacher_add" cols="40" rows="3"><? echo $fetch['teacher_add'] ?></textarea>
      </span></td>
    </tr>
      <tr>
      <td height="35" align="right" bgcolor="#999999"><span class="style_1">เบอร์โทร</span></td>
      <td height="35" bgcolor="#999999">:</td>
      <td height="35" bgcolor="#999999"><span class="style_1">
        <input name="teacher_tel" type="text" id="teacher_tel" size="30" maxlength="40" onblur="return checkemail()" value="<? echo $fetch['teacher_tel'] ?>"/>
      </span></td>
    </tr>
   <tr>
      <td height="35" align="right" bgcolor="#999999"><span class="style_1">รูปภาพ</span></td>
      <td height="35" bgcolor="#999999">:</td>
      <td height="35" bgcolor="#999999"><input type="file" name="teacher_image" id="teacher_image" <? echo $fetch['teacher_image'] ?> /></td>
    </tr>
    
    
    
    <tr>
      <td height="35" bgcolor="#999999">&nbsp;</td>
      <td height="35" bgcolor="#999999">&nbsp;</td>
      <td height="40" bgcolor="#999999"><span class="style_1">
        <input type="submit" name="Submit" id="Submit" value=" บันทึก  " />
      </span></td>
    </tr>
    <tr>
      <td bgcolor="#999999">&nbsp;</td>
      <td bgcolor="#999999">&nbsp;</td>
      <td bgcolor="#999999">&nbsp;</td>
    </tr>
  </table>
</form>
</div>

</body>
</html>


